home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Demo's / Igor Demo Pro / 1 PutContentsIn Igor Pro Folder / WaveMetrics Procedures / Analysis / WMFunctions < prev   
Text File  |  1994-02-18  |  2KB  |  61 lines

  1. | PEAK FUNCTIONS
  2.  
  3. | Gaussian, amplitude= k1, center= k2, width (fwhm) = 2*sqrt(ln(2))*k3, area =  k1*k3*sqrt(Pi)
  4. Function/D gauss(k1,k2,k3)
  5.     Variable/D k1,k2,k3
  6.     return k1*exp(-((x-k2)/k3)^2)
  7. End
  8.  
  9. | Lorentzian, amplitude= k1/k3, center= k2, width (fwhm) = 2*sqrt(k3), area =   Pi*k1/sqrt(k3)
  10. Function/D lor(k1,k2,k3)
  11.     Variable/D k1,k2,k3
  12.     return k1/((x-k2)^2+k3)
  13. End
  14.  
  15. | Note that the constants are single-precision; your waves must also be single-precision. 
  16. | Voigt profile, center = 0, amplitude = voigt(0,y),
  17. |     width (fwhm) = (y+sqrt(y*y+4*ln(2))) [+/- 1%], area = sqrt(Pi)
  18. Function Voigt(X,Y)
  19.     variable X,Y
  20.  
  21.     variable/C W,U,T= cmplx(Y,-X)
  22.     variable S =abs(X)+Y
  23.  
  24.     if( S >= 15 )                                |        Region I
  25.         W= T*0.5641896/(0.5+T*T)
  26.     else
  27.         if( S >= 5.5 )                             |        Region II
  28.             U= T*T
  29.             W= T*(1.410474+U*0.5641896)/(0.75+U*(3+U))
  30.         else
  31.             if( Y >= (0.195*ABS(X)-0.176) )     |        Region III
  32.                 W= (16.4955+T*(20.20933+T*(11.96482+T*(3.778987+T*0.5642236))))
  33.                 W /= (16.4955+T*(38.82363+T*(39.27121+T*(21.69274+T*(6.699398+T)))))
  34.             else                                    |        Region IV
  35.                 U= T*T
  36.                 W= T*(36183.31-U*(3321.9905-U*(1540.787-U*(219.0313-U*(35.76683-U*(1.320522-U*0.56419))))))
  37.                 W /= (32066.6-U*(24322.84-U*(9022.228-U*(2186.181-U*(364.2191-U*(61.57037-U*(1.841439-U)))))))
  38.                 W= cmplx(exp(real(U))*cos(imag(U)),0)-W
  39.             endif
  40.         endif
  41.     endif
  42.     return real(W)
  43. end
  44.  
  45.  
  46. | Doniac-Sunjic lineshape for photoelectron spectroscopy.
  47. |  This version builds XPS core lineshapes in K.E. mode.
  48. | (See Physical Review Letters 61, 357 (1988) for source and authors of this version.)
  49. | "Dr. K.-M. Schindler" <schindler@fhi-berlin.mpg.d400.de>
  50. Function/D DoniacSunjic(Ee, Alpha, Gamma, EF)
  51.         Variable/D Ee, Alpha, Gamma, EF
  52.  
  53.         Variable/D Eps, OneAlp, Tmp
  54.         Eps = Ee - EF
  55.         OneAlp = 1. - Alpha
  56.         Tmp = (Eps * Eps + Gamma * Gamma) ^ (-.5 * OneAlp)
  57.         Tmp = Tmp *  cos(Pi/2 * Alpha + OneAlp * atan2(Eps,Gamma))
  58.         return Tmp / sin(Pi * OneAlp)
  59. End
  60.  
  61.